<?php 

try{
	header('content-type:text/html;charset=utf-8');
	$pdo = new PDO('mysql:host=localhost; dbname=newbusiness', 'root', 'root');
	$userid = $_GET['userid'];

	$sql = 'select * from member';
	
	//prepare($sql)； 准备一条SQl语句。
	$stmt = $pdo->prepare($sql);
	//execute(); 执行一条预处理语句
	$res = $stmt->execute();
	if($res) {
		while($row = $stmt->fetch()) {
			if($userid == $row['userid']){
				?>
				<!DOCTYPE html>
				<html lang="en">
				<head>
					<meta charset="UTF-8">
					<title>截图页面</title>
					<meta name="viewport" content="width=device-width,initial-scale=0.7, minimum-scale=0.7, maximum-scale=0.7, user-scalable=no"/>
				</head>
				<body>
					<table style="background-image: url(img/beijing.jpg);font-size: 20px;font-family:楷体; " width="500px" height="800px" align="center">
						<tr>
							<td height="320px" width="250px"></td>
							<td height="320px" width="250px"></td>
						</tr>
						<tr>
							<td height="40px" width="150px" align="right">姓名：</td>
							<td height="40px" width="350px" align="left"><?php print_r($row['username']); ?></td>
						</tr>
						<tr>
							<td height="40px" width="150px" align="right">学号：</td>
							<td height="40px" width="350px" align="left"><?php print_r($row['userid']); ?></td>
						</tr>
						<tr>
							<td height="40px" width="150px" align="right">身份证号：</td>
							<td height="40px" width="350px" align="left"><?php print_r($row['userids']); ?></td>
						</tr>
						<tr>
							<td height="40px" width="150px" align="right">系别：</td>
							<td height="40px" width="350px" align="left"><?php print_r($row['userxibie']); ?></td>
						</tr>
						<tr>
							<td height="40px" width="150px" align="right">班级：</td>
							<td height="40px" width="290px" align="left" style="word-wrap: break-word;padding-right: 60px;"><?php print_r($row['userclass']); ?></td>
						</tr>
						<tr>
							<td height="40px" width="150px" align="right">编号：</td>
							<td height="40px" width="350px" align="left"><?php print_r($row['usertime']); ?></td>
						</tr>
						<tr>
							<td height="100%" width="250px"></td>
							<td height="100%" width="250px"></td>
						</tr>
					</table>
				</body>
				</html>
				<?php
			}
		}
	}
	/*echo "<br>";
	echo $pdo->errorCode();
	echo "<br>";
	print_r($pdo->errorInfo());*/
}catch(PDOException $e) {
	echo $e->getMessage();
}
?>
